{% extends "ads/base.html" %}

{% load i18n %}

{% block meta %}{{ block.super }}
<meta name="keywords" content="brazil england china russia india japan">
{% endblock meta %}

{% block body %}

{% if user.is_authenticated %}
<div class="clear_both">
    <div class="box orange al_center">
        <a href="create_advertiser/">{% trans "Create a new Advertiser" %}</a>
    </div>

    {% if user.is_superuser or perms.ads.add_website %}
    <div class="box blue al_center">
        <a href="create_website/">{% trans "Create a new Website" %}</a>
    </div>
    {% endif %}
</div>

<div class="box silver clear_both">
    <h2>{% trans "Advertiser accounts" %}</h2>

    {% if user.advertiser_users.count %}
    <ul>
        {% for aduser in user.advertiser_users.all %}
        <li><a href="{{ aduser.advertiser.get_absolute_url }}">{{ aduser.advertiser }}</a></li>
        {% endfor %}
    </ul>
    {% else %}
    {% trans "You have no advertiser accounts!" %}
    {% endif %}
</div>

<div class="box silver clear_both">
    <h2>{% trans "Website accounts" %}</h2>

    {% if user.website_users.count %}
    <ul>
        {% for webuser in user.website_users.all %}
        <li><a href="{{ webuser.website.get_absolute_url }}">{{ webuser.website }}</a></li>
        {% endfor %}
    </ul>
    {% else %}
    {% trans "You have no advertiser accounts!" %}
    {% endif %}
</div>

{% else %}

{% trans "You need to be authenticated to have or change advertiser e website accounts" %}
    
{% endif %}

{% endblock body %}

